package Text.Text1;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/*
 *@Student 张策
 */
public class text5 {
    public static void main(String[] args) {
        T5 t5 = new T5();
        t5.io();
    }
}
class T5 {

    public void io() {
        FileOutputStream fileOutputStream = null;
        String name = "e:\\T5.txt";
        try {
            fileOutputStream = new FileOutputStream(name,true);
            fileOutputStream = new FileOutputStream(name);
//            fileOutputStream.write('a');
            String str = "hello";
            fileOutputStream.write(str.getBytes());
//            fileOutputStream.write(str.getBytes(), 1, 3);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}